package graphicsExtended.templates.abstractClass;

import graphicsExtended.templates.interfaces.Drawable;
import graphicsExtended.templates.interfaces.MouseInteractable;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Point;
import java.awt.image.BufferedImage;

/**
 *
 * @author Shimu
 */
public abstract class Selectable implements Drawable,
        MouseInteractable {

    /**
     * The sentinel selectable that can never be selected and its
     * selected, deselected, and draw methods do nothing.
     */
    public static final Selectable SENTINEL_SELECTABLE = new Selectable() {

        public boolean isSelected(Point mouseCoord) {
            return false;
        }

        @Override
        public void selected(Point mouseLocation) {
        }

        @Override
        public void mouseClicked(Point mouseLocation) {
        }

        @Override
        public void draw(Graphics2D g) {
        }

        public void setIcon(Image img) {
        }

        public Image getIcon() {
            return new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
        }

        public String getDescription() {
            return null;
        }
    };

    public abstract boolean isSelected(Point mouseCoord);
}
